//
//  UIView+Ex.swift
//  
//
//  Created by tank on 2021/12/16.
//

import Foundation
import AppFoundation
import UIKit

extension Extension where Base: UIView {

    public var viewController: UIViewController? {
        if let nextResponder = base.next as? UIViewController {
            return nextResponder
        } else if let nextResponder = base.next as? UIView {
            return nextResponder.ex.viewController
        } else {
            return nil
        }
    }
}
